<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .c {
        background-color: pink;
      }
      .bd {
        border: 1px solid #000;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <div :style="{width:w,height:h}" :class="{c: isRed,bd :isBd}"></div>
      <button @click="isRed=!isRed">切换颜色</button>
      <button @click="isBd=!isBd">切换边框</button>
    </div>
    <script src="./vue.js"></script>
    <script>
      new Vue({
        el: "#app",
        data: {
          isBd: true,
          isRed: true,
          w: "400px",
          h: "300px",
          color: "red",
          //   c: "skyblue",
        },
      })
    </script>
  </body>
</html>
